package day0717;

import java.util.Random;
import java.util.Scanner;

public class Test11 {
    public static void main(String[] args) {

        Random ra=new Random();//产生两个数字，构成一个乘法题
        Scanner sc=new Scanner(System.in);//输入答案
        int count=0;
        for (int i = 1; i <= 5; i++) {
            int a=ra.nextInt(20);
            int b=ra.nextInt(20);
            System.out.println(a+ "*"  + b +"=");
            //用Scanner输入回答答案，并显示对错。
            int answer=sc.nextInt();
            if(answer == a*b){
                System.out.println("回答正确");
                count++;
            }else{
                System.out.println("回答错误");
            }
        }
        System.out.println("回答正确的题目数为："  + count);



    }
}
